#include "add.h"



int main()
{
    
    int shmid = CreatMomery();
    std:: cout << "momery = " << shmid << std::endl;

    // 链接后
    // 
    char * shmadr = (char *)LinkMem(shmid);

    int cnt = 0;
    
    while(true)
    {
        int ret = snprintf(shmadr,MAX_SIZE,"你好,我是server.cpp进程，这是我的%d次向你发送信息\n",++cnt);
  
        std::cout << "我运行到sever.cpp的while循环这里了" << std::endl;
               

        sleep(5);
    }

    // 销毁链接为何用的内存其实，底层OS做的
    UnLinkMem(shmadr);
    
    

    // 删除共享内存
    DeleteMem(shmid);
  
    return 0;
}